import request from "./useRequests";
import { userinfo } from '@/stores/counter'
import { ElMessage } from 'element-plus'

export default function getNotices() {
    const user = userinfo()
    async function setNotices() {
        try {
            const res = await request({
                method: "get",
                url: `/news/getNotices`,
                params: {
                    "page": 1,
                    "limit": 10
                }
            })
            user.notices = res.data.data.list

        } catch (err: any) {
            //alert(err)
        }
    }

    return {
        setNotices
    }
}